<template>
    <div class="home">
        <el-container>
            <el-header>Header
                <el-button @click="logout">退出</el-button>
            </el-header>
            <el-container>
                <el-aside width="200px">
                    <el-menu
                        :default-active="this.$route.path"
                        router
                    >
                        <el-sub-menu index="1">
                            <template #title>
                                <span>用户管理</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item
                                    index="/MyselfUsers"
                                >
                                    <el-icon><Menu /></el-icon>个人用户
                                </el-menu-item>
                            </el-menu-item-group>
                            <el-menu-item-group>
                                <el-menu-item
                                    index="/TeamUsers"
                                >
                                    <el-icon><Menu /></el-icon>团队用户
                                </el-menu-item>
                            </el-menu-item-group>
                        </el-sub-menu>
                        <el-sub-menu index="2">
                            <template #title>
                                <span>体温管理</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item
                                    index="/MyselfData"
                                >
                                    <el-icon><Menu /></el-icon>个人列表
                                </el-menu-item>
                            </el-menu-item-group>
                            <el-menu-item-group>
                                <el-menu-item
                                    index="/TeamData"
                                >
                                    <el-icon><Menu /></el-icon>团队列表
                                </el-menu-item>
                            </el-menu-item-group>
                        </el-sub-menu>
                        <el-sub-menu index="3">
                            <template #title>
                                <span>权限管理</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item
                                    index="/Power"
                                >
                                    <el-icon><Menu /></el-icon>角色列表
                                </el-menu-item>
                            </el-menu-item-group>
                        </el-sub-menu>
                    </el-menu>
                </el-aside>
                <el-main>
                    <router-view></router-view>
                </el-main>
            </el-container>
        </el-container>    
    </div>
</template>

<script setup>
    import { useRoute, useRouter } from 'vue-router'

    const router = useRouter()

    const logout =function(){
        localStorage.removeItem('userInfo')
        router.replace('/Login')
    }

</script>

<style lang="scss" scoped>
    
</style>